home *** CD-ROM | disk | FTP | other *** search
- Path: news.netam.net!alpha!bgc
- From: bgc@alpha.netam.net (The Bowling Green Connection)
- Newsgroups: comp.lang.c
- Subject: Help! Good methods for locking files?
- Date: 15 Mar 1996 19:22:45 GMT
- Organization: NetAmerica, Bowling Green, KY.
- Message-ID: <4icg25$csg@news.netam.net>
- NNTP-Posting-Host: alpha.netam.net
- X-Newsreader: TIN [version 1.2 PL2]
-
- Here is the situation:
- I am writing a cgi program for the internet in C. When a web surfer clicks
- a SUBMIT button, the information he typed on the screen will be sent
- to a FILE, and that file will be MAILED off with a system() procedure
- that calls a Unix mailto command.
-
- The problem is that two or more web surfers could click a SUBMIT button
- at the same time, which would cause mayhem if not for file locking.
-
- How can I ensure that 1) The file (which always has the same name) is
- not overwritten by a simultaneous click, and 2) that the file is not
- overwritten before the mailto command gets finished mailing it off?
-
- Help would be greatly appreciated!
- _______________________________________________________________________________
- Edgar E. Easterly, IV (bgc@bgcky.com) Bowling Green, Kentucky -=O=-
- "Except the Lord build thy house, ye labour in vain that build it; Except *
- the Lord keep thy city, the watchman will awake but in vain." Psalms 127:1 |
-